import java.util.Arrays;

/**
 * 打印顺序表  物理地址连续的存储单元      逻辑上 物理上都是连续的
 */
public class TestDome1 {
   public static void main(String[] args) {
      //打印顺序表
      MyArrayList myArrayList=new MyArrayList();
      myArrayList.add(0,1);
      myArrayList.add(1,2);
      myArrayList.add(2,3);
      myArrayList.display();
      myArrayList.remove(1);
      myArrayList.display();

      System.out.println(myArrayList.contains(3));
      System.out.println(myArrayList.getPos(5));
      System.out.println(myArrayList.search(4));


   }
}



/* public static void func(int[] array3,int[] array4) {
        for(int i=0;i<array3.length;i++) {
            int tmp=array3[i];
            array3[i]=array4[i];
            array4[i]=tmp;
        }
    }
    public static void main(String[] args) {
        int[] arrary={1,2,3,4,5,6};
        int[] arrary1={9,8,7,6,5,4};
        System.out.println("没改变之前：");
        System.out.println(Arrays.toString(arrary));
        System.out.println(Arrays.toString(arrary1));
        System.out.println("改变之后：");
        func(arrary,arrary1);
        System.out.println(Arrays.toString(arrary));
        System.out.println(Arrays.toString(arrary1));
    }*/
    /*public static void main(String[] args) {
        int[] arrary={1,2,3,4,5,6};
        func(arrary);
        System.out.println(Arrays.toString(arrary));
    }*/

/*
    public static void func(int[] arrary) {
        int left=0;
        int right=arrary.length-1;
        while(left<right) {
            while(left<right && arrary[left]%2==0) {
                left++;
            }
            while (left<right && arrary[right]%2!=0) {
                right--;
            }
            int tmp=arrary[left];
            arrary[left]=arrary[right];
            arrary[right]=tmp;
        }
    }*/
